<?php
/**
 * @version $Id$
 * @package    Jmonoslideshow
 * @author     Matthieu BARBE {@link http://www.ccomca.com}
 * @author     Created on 04-Sep-2009
 */

//-- No direct access

// Check to ensure this file is included in Joomla!
defined('JPATH_BASE') or die();

class JElementColorText extends JElement
{
	var	$_name 			= 'ColorText';
	var $_phocaParams 	= null;

	function fetchElement($name, $value, &$node, $control_name)
	{
		$option 	= JRequest::getCmd('option');
		
		
		
		// Color Picker
		JHTML::stylesheet( 'picker.css', 'components/com_jmonoslideshow/assets/css/' );
		JHTML::script( 'picker.js', 'components/com_jmonoslideshow/assets/js/' );
		

		$size = ( $node->attributes('size') ? 'size="'.$node->attributes('size').'"' : '' );
		$class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="text_area"' );
        /*
         * Required to avoid a cycle of encoding &
         * html_entity_decode was used in place of htmlspecialchars_decode because
         * htmlspecialchars_decode is not compatible with PHP 4
         */
        $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES);

		
		$html ='<input type="text" name="'.$control_name.'['.$name.']" id="'.$control_name.$name.'" value="'.$value.'" '.$class.' '.$size.' />';		
		
		// Color Picker
		$html .= '<span style="margin-left:10px" onclick="openPicker(\''.$control_name.$name.'\')"  class="picker_buttons">' . JText::_('COM_JMONOSLIDESHOW_PICK_COLOR') . '</span>';
		
		
	return $html;
	}
	
	
}
?>